package com.kadoufall.recommender.web;

import com.kadoufall.recommender.dao.NewsRepository;
import com.kadoufall.recommender.dao.UserRepository;
import com.kadoufall.recommender.model.News;
import com.kadoufall.recommender.model.User;
import com.kadoufall.recommender.service.contentBased.ContentBasedRecommenderService;
import com.kadoufall.recommender.service.hot.HotRecommenderService;
import com.kadoufall.recommender.service.userCF.UserCFRecommenderService;
import com.kadoufall.recommender.service.util.UtilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    UserRepository userRepository;

    @RequestMapping(value = "/find/{userId}", method = RequestMethod.GET)
    public User find(@PathVariable long userId) {
//        System.out.println("in CF recommend");
        return userRepository.findById(userId);
    }

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public User add() {
        return userRepository.save(new User());
    }

}
